Skip to main content

eventOptionKey

Type

function

Summary

Returns the state of the Alt key.

Syntax

the eventOptionKey
eventOptionKey()

Description

Use the eventOptionKey function to check whether the Alt key, Meta key, or Option key was pressed at the time the current event was dispatched. You can use eventOptionKey to add alternative capabilities to user actions such as clicking.

If you want to check the state of the Alt key at the current time, rather than when the event was dispatched, use the optionKey function.

The eventAltKey and eventOptionKey functions return the same value. Which one to use is a matter of preference. The terminology varies depending on platform. Users of different operating systems may know this key as the Option key (Mac OS systems), Meta key (Unix systems), or Alt key (Windows systems).

*Warning

*: the value of this function is undefined after performing a wait operation; it may no longer be the same as the value when the event was dispatched.

Examples

put the eventOptionKey into keyState
if the eventOptionKey is down then exit rawKeyDown

constant: return

control structure: function

function: eventOptionKey, value, keysDown, altKey

glossary: Meta key, return, function, Alt key

message: optionKeyDown

Compatibility and Support

Introduced

LiveCode 8.1

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?